<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>
        <button type="button" onclick="c()" id="btn1">求点击</button>
    </div>
    <script>
        function c(){
            var obj=document.getElementById("btn1");
            obj.innerHTML="谢谢";
        }
        function greeting(hour){
            if(hour < 6){return "凌晨好！"}
            else if (hour < 9){return "早上好！";}
            else if (hour < 12){return "上午好！";}
            else if (hour < 14){return "中午好！";}
            else if (hour < 17){return "下午好！";}
            else if (hour < 19){return "傍晚好！";}
            else if (hour < 22){return "晚上好！";}
            else {return "夜里好！";}
        }
        function fruits(){
            var fruits = ["苹果" ,"香蕉","梨子","西瓜","火龙果","芒果","荔枝"];
            var num=parseFloat(random()*10);
            for(var i= 0; i<fruits.length;i++){
                if (num==i){
                    alert(num[i]);
                    break;
                }
            }
        }
    </script>
</body>
</html>